cmake_minimum_required(VERSION 3.18)

project ( LC3VM_JIT C CXX)

find_package(PkgConfig REQUIRED)
pkg_search_module(GLIB REQUIRED glib-2.0)

include_directories(
    include
    ${GLIB_INCLUDE_DIRS}
    /usr/local/include/xbyak
)

set (CMAKE_EXE_LINKER_FLAGS "-static")

set (SRC_BASIC
    blk.c
    intrp.c
    mach.c
)

set (SRC_MAIN 
    main.c
)

set (SRC_JIT
    helper.c
    exec.c
    jit.cpp
)
add_library (basic STATIC ${SRC_BASIC})
add_library(jit STATIC ${SRC_JIT})
add_executable(lc3vm_jit ${SRC_MAIN})
target_link_libraries(lc3vm_jit basic jit ${GLIB_LIBRARIES})